package com.zhiqiang.nativeplayer;

import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;

/**
 * author：paul
 * date：Created in 14:41 2022/11/21
 * welcome page for application startup
 */
@RestController
public class Greeting {

    @CrossOrigin
    @GetMapping("/greeting")
    public GreetingResp sayGreeting(){
        String dt = LocalDateTime.now().toString();
        System.out.println("/Greeting");
        GreetingResp gr = new GreetingResp();
        gr.setDateTime(dt);
        gr.setContent("hello!");
        //fileLoadHandler.loadConfigFile(); TODO
        return gr;
    }

}

class GreetingResp{
    private String dateTime;
    private String content;

    public String getDateTime() {
        return dateTime;
    }

    public void setDateTime(String dateTime) {
        this.dateTime = dateTime;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }
}
